import os

def test1():
    path=os.getcwd()#存储连上的用户的路径 eg.E:\python_study\my_python\my_netdisc
    print(path)

    data=''
    for file in os.listdir(path):
    #显示即为（文件名 文件大小），\n是换行
        data+=file+''*5+str(os.stat(file).st_size)+'\n'
    print(data)


def test2():
    print('cd   dir1'.split()) # 分割命令为 ['cd', 'dir1']


import hashlib

def test3():
    f = open('./file1', 'rb')
    f_md5 = hashlib.md5()
    f_md5.update(f.read())
    print (f_md5.hexdigest())



if __name__ == '__main__':
    # test1()
    # test2()
    test3()
